<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>登录 - 项目管理系统</title>
  <!-- 使用本地Bootstrap CSS -->
  <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
  <!-- 使用本地Font Awesome -->
  <link rel="stylesheet" href="{{ url_for('static', filename='css/all.min.css') }}">
  <style>
    body {
      background: linear-gradient(135deg, #1a2a3a, #324759);
      height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0;
      font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
    }
    
    .login-container {
      max-width: 400px;
      width: 100%;
      padding: 20px;
    }
    
    .card {
      border-radius: 15px;
      box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
      border: none;
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
    }
    
    .card-header {
      background: linear-gradient(135deg, #1a2a3a, #324759);
      border-bottom: none;
      text-align: center;
      padding: 30px 20px;
      border-radius: 15px 15px 0 0 !important;
    }
    
    .system-title {
      font-size: 28px;
      font-weight: 600;
      color: #ffcc66;
      margin-bottom: 10px;
      text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    }
    
    .login-title {
      font-size: 16px;
      color: #e0e6ec;
      letter-spacing: 1px;
    }
    
    .card-body {
      padding: 40px;
    }
    
    .form-group {
      margin-bottom: 25px;
    }
    
    .btn-login {
      background: #ffcc66;
      border: none;
      font-weight: 600;
      padding: 12px 0;
      font-size: 16px;
      width: 100%;
      border-radius: 50px;
      color: #1a2a3a;
      margin-top: 20px;
    }
    
    .btn-login:hover {
      background: #ffc107;
    }
    
    .alert {
      border-radius: 10px;
      margin-bottom: 20px;
    }

    .db-actions {
      margin-top: 20px;
      padding-top: 20px;
      border-top: 1px solid #eee;
    }

    .btn-db {
      width: 100%;
      margin-bottom: 10px;
      border-radius: 50px;
      font-weight: 500;
      padding: 12px 0;
      font-size: 16px;
      border: none;
      transition: all 0.3s ease;
    }

    .btn-create-db {
      background: #28a745;
      color: white;
    }

    .btn-create-db:hover {
      background: #218838;
      color: white;
      transform: translateY(-2px);
    }

    .btn-init-db {
      background: #17a2b8;
      color: white;
    }

    .btn-init-db:hover {
      background: #138496;
      color: white;
      transform: translateY(-2px);
    }

    .btn i {
      margin-right: 8px;
    }
  </style>
</head>
<body>
  <div class="login-container">
    <div class="card">
      <div class="card-header">
        <h1 class="system-title">项目管理系统</h1>
        <p class="login-title">请登录以继续</p>
      </div>
      <div class="card-body">
        <!-- 闪现消息 -->
        {% with messages = get_flashed_messages(with_categories=true) %}
          {% if messages %}
            {% for category, message in messages %}
            <div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
              {{ message }}
              <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            {% endfor %}
          {% endif %}
        {% endwith %}
        
        <!-- 登录表单 -->
        <form method="post" action="{{ url_for('login') }}">
          <div class="form-group">
            <label for="username">用户名</label>
            <input type="text" class="form-control" id="username" name="username" required>
          </div>
          
          <div class="form-group">
            <label for="password">密码</label>
            <input type="password" class="form-control" id="password" name="password" required>
          </div>
          
          <button type="submit" class="btn btn-login">
            <i class="fas fa-sign-in-alt"></i> 登录
          </button>
        </form>
      </div>
    </div>
  </div>
  
  <!-- 使用本地JavaScript -->
  <script src="{{ url_for('static', filename='js/bootstrap.bundle.min.js') }}"></script>
</body>
</html> 